﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace ESF.WinForms.Dialogs
{
	/// <summary>
	/// Interaction logic for ProgressDialogWPF.xaml
	/// </summary>
	public partial class ProgressDialogControlWPF : UserControl
	{
		#region Eventos

		public event Action OnOK;

		public event Action OnCancel;

		#endregion


		#region Constructor

		public ProgressDialogControlWPF()
		{
			InitializeComponent();


			imgIcon.Source = WinFormsHelper.ToBitmapSource(ESF.WinForms.Properties.Resources.Clock_64x64);
		}

		#endregion


		#region Button Events

		private void btnOK_Click(object sender, RoutedEventArgs e)
		{
			if (OnOK != null && prgProgressBar.Value == 100)
			{
				OnOK ();
			}
		}

		private void btnCancel_Click(object sender, RoutedEventArgs e)
		{
			if (OnCancel != null)
			{
				OnCancel ();
			}
		}

		#endregion
	}
}
